//
//  GYEvaluateView.m
//  GoodLuck
//
//  Created by apple on 2018/2/6.
//  Copyright © 2018年 yunjiazhineng. All rights reserved.
//

#import "GYEvaluateView.h"

@interface GYEvaluateView ()

@property (weak, nonatomic) IBOutlet UIButton *allEvaluateBtu;

@property (weak, nonatomic) IBOutlet UIButton *goodBtu;
@property (weak, nonatomic) IBOutlet UIButton *inBtu;
@property (weak, nonatomic) IBOutlet UIButton *badBtu;
@property (weak, nonatomic) IBOutlet UIButton *orderBtu;

@end

@implementation GYEvaluateView
- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self.allEvaluateBtu setBackgroundColor:NaviTextColor];
    [self.goodBtu setBackgroundColor:RGBColor(170, 170, 170)];
    [self.inBtu setBackgroundColor:RGBColor(170, 170, 170)];
    [self.badBtu setBackgroundColor:RGBColor(170, 170, 170)];
    [self.orderBtu setBackgroundColor:RGBColor(170, 170, 170)];
}

- (IBAction)evaluateClick:(UIButton *)sender {
    
    switch (sender.tag) {
        case 1:
        {
            NSLog(@"点击了全部评价按钮...");
            [self.allEvaluateBtu setBackgroundColor:NaviTextColor];
            [self.goodBtu setBackgroundColor:RGBColor(170, 170, 170)];
            [self.inBtu setBackgroundColor:RGBColor(170, 170, 170)];
            [self.badBtu setBackgroundColor:RGBColor(170, 170, 170)];
            [self.orderBtu setBackgroundColor:RGBColor(170, 170, 170)];
        }
            break;
        
        case 2:
        {
            NSLog(@"点击了好评按钮...");
            [self.allEvaluateBtu setBackgroundColor:RGBColor(170, 170, 170)];
            [self.goodBtu setBackgroundColor:NaviTextColor];
            [self.inBtu setBackgroundColor:RGBColor(170, 170, 170)];
            [self.badBtu setBackgroundColor:RGBColor(170, 170, 170)];
            [self.orderBtu setBackgroundColor:RGBColor(170, 170, 170)];
        }
            break;
            
        case 3:
        {
            NSLog(@"点击了中评按钮...");
            [self.allEvaluateBtu setBackgroundColor:RGBColor(170, 170, 170)];
            [self.goodBtu setBackgroundColor:RGBColor(170, 170, 170)];
            [self.inBtu setBackgroundColor:NaviTextColor];
            [self.badBtu setBackgroundColor:RGBColor(170, 170, 170)];
            [self.orderBtu setBackgroundColor:RGBColor(170, 170, 170)];
        }
            break;
            
        case 4:
        {
            NSLog(@"点击了差评按钮...");
            [self.allEvaluateBtu setBackgroundColor:RGBColor(170, 170, 170)];
            [self.goodBtu setBackgroundColor:RGBColor(170, 170, 170)];
            [self.inBtu setBackgroundColor:RGBColor(170, 170, 170)];
            [self.badBtu setBackgroundColor:NaviTextColor];
            [self.orderBtu setBackgroundColor:RGBColor(170, 170, 170)];
        }
            break;
            
        case 5:
        {
            NSLog(@"点击了订单晒图按钮...");
            [self.allEvaluateBtu setBackgroundColor:RGBColor(170, 170, 170)];
            [self.goodBtu setBackgroundColor:RGBColor(170, 170, 170)];
            [self.inBtu setBackgroundColor:RGBColor(170, 170, 170)];
            [self.badBtu setBackgroundColor:RGBColor(170, 170, 170)];
            [self.orderBtu setBackgroundColor:NaviTextColor];
        }
            break;
            
        default:
            break;
    }
    
    //按钮回调
    self.goodsEvaluateCallBack(sender.tag);
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.allEvaluateBtu.titleLabel.font = [UIFont systemFontOfSize:widthScale(15, iphone6_W)];
    self.goodBtu.titleLabel.font = [UIFont systemFontOfSize:widthScale(15, iphone6_W)];
    self.inBtu.titleLabel.font = [UIFont systemFontOfSize:widthScale(15, iphone6_W)];
    self.badBtu.titleLabel.font = [UIFont systemFontOfSize:widthScale(15, iphone6_W)];
    self.orderBtu.titleLabel.font = [UIFont systemFontOfSize:widthScale(15, iphone6_W)];
    
    self.allEvaluateBtu.layer.cornerRadius = 4;
    self.goodBtu.layer.cornerRadius = 4;
    self.inBtu.layer.cornerRadius = 4;
    self.badBtu.layer.cornerRadius = 4;
    self.orderBtu.layer.cornerRadius = 4;
}



@end
